<?php

Route::group(['middleware' => ['web']], function () {

    Route::get('/', 'Home\IndexController@index');
    Route::get('/cate/{cate_id}', 'Home\IndexController@cate');
    Route::get('/a/{art_id}', 'Home\IndexController@article');
});

Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware' => ['web']], function () {
    Route::any('login','LoginController@login');
    Route::get('code','LoginController@code');
});

Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware' => ['web','admin.login']], function () {
    Route::get('/','IndexController@index');
    Route::get('info','IndexController@info');
    Route::get('quit','LoginController@quit');
    Route::any('pass','IndexController@pass');
    Route::post('cate/changeorder','CategoryController@changeOrder');
    //资源路由 文章分类 增删改查
    Route::resource('category','CategoryController');

    //文章内容 增删改查
    Route::resource('article','ArticleController');
    //友情链接
    Route::resource('links','LinksController');
    Route::post('links/changeorder','LinksController@changeOrder');
    //自定义导航
    Route::resource('navs','NavsController');
    Route::post('navs/changeorder','NavsController@changeOrder');

    //网站配置项
    Route::get('config/putfile', 'ConfigController@putFile');
    Route::post('config/changecontent', 'ConfigController@changeContent');
    Route::post('config/changeorder', 'ConfigController@changeOrder');
    Route::resource('config', 'ConfigController');


    Route::any('upload','CommonController@upload');
});
